<html><head>
<title>个人中心</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

<link rel="stylesheet" type="text/css" href="{$app_path}{$static_path}/css/user-center.css">
<link rel="stylesheet" type="text/css" href="{$app_path}{$static_path}/css/page.css">
<include file="./Public/public/public.html" />
</head>
<body>
<include file="./Public/public/top.html" />

<div class="layout-wrap">
    <!--已审核-->
    <div class="layout">
<include file="./Public/public/centerLeft.html" />                      
<link rel="stylesheet" type="text/css" href="{$app_path}{$static_path}/css/savecredit.css">

<div class="right" ms-controller="right" style="min-height: 882px;height:1100px;">

<form id="BorrowForm" action="{:U('Mycredit/insertloader')}" method="post" novalidate="true">
<input type="hidden" name="domainid" value="" id="domainid"/>
		<div class="col-sm-10 ">
			<div class="container_page wyjr_area">
				<section>
					<h2>我要借入</h2>
					<p class="info-box" style="display: none;">
						您还没有质押域名获取授信额度，不能申请贷款。 <a href="/Loan/pledge.html"><strong>马上质押</strong></a>
					</p>
					<div class="form-horizontal form-wyjr">
						<div class="bg_grey clearfix">
							<div id="result" class="m160">
								<div class="content">
									<span class="popover-close"></span>
									<ul>
										<li>总利息：<span id="zlx" class="font_c_orange"></span>
											总管理费：<span id="zglf" class="font_c_orange"></span></li>
										<li>每月还款：<span id="myfk" class="font_c_orange"></span> 
										(利息：<span id="lx" class="font_c_orange"></span>,
										管理费：<span id="myglf" class="font_c_orange"></span>)</li>
										<li>最后本金需还款：<span id="zhhk" class="font_c_orange"></span></li>
									</ul>
								</div>
							</div>


							<div class="form-group">
								<label for="Amount" class=" control-label col-sm-1"><i>*</i>借款标题：</label>
								<div class="col-sm-2 Amount_area">
									<input class="form-control2" id="title" name="title" type="text" value="" size="58">
									<span id="title"></span>
								</div>
								<p class="form-control-static">
								</p>
								<span class="form-control-tips " style="display: none"><i class="iconfont"></i>提示文字</span>
							</div>
							
							
							<div class="form-group">
								<label for="Amount" class=" control-label col-sm-1"><i>*</i>域名类型：</label>
								<div class="col-sm-2 Amount_area">
									<select class="form-control" name="category" id="categorid">
										<option value="">-请选择-</option>
										<volist name="catelist" id="vo">
											<option value='{$vo.id}'>{$vo.name}</option>
										</volist>
									</select>
									<span id="title"></span>
								</div>
								<p class="form-control-static">
								</p>
								<span class="form-control-tips " style="display: none"><i class="iconfont"></i>提示文字</span>
							</div>
									
							<div class="form-group" style="margin-bottom: 10px;">
								<label for="input6" class=" control-label col-sm-1"><i>*</i>质押物：</label>
								<div class="col-sm-8">
									<div class="select_list_area" style="min-height:104px;max-height: 204px">
										<ul style="list-style: none;margin: 0;" id="domainlistid">
										<!-- <volist name="domlist" id="vo">
											<li><label>
											<input type="checkbox" value="{$vo.id}" data-amount="{$vo.id}" name="domainidstr">
											{$vo.domain} - {$vo.name}</label></li>
										</volist> -->
										</ul>
									</div>
								</div>
								<span class="form-control-tips " style="display: none"><i class="iconfont"></i>提示文字</span>
							</div>
							<div class="form-group ">
								<label for="sall" class="sall_area">
									<input id="sall" type="checkbox">
									<span>选择全部&nbsp;&nbsp;&nbsp;&nbsp;您目前有<span id="diyacount">{$count}</span>个域名可以用于抵押贷款</span>
								</label>

							</div>
							<div class="form-group">
								<label for="Amount" class=" control-label col-sm-1"><i>*</i>借款总额：</label>
								<div class="col-sm-2 Amount_area">
									<input class="form-control" id="Amount" name="money" type="number" value="">
									<span id="Amountdx"></span>
								</div>
								<p class="form-control-static">请保持为100的整数倍
								</p>
								<span class="form-control-tips " style="display: none"><i class="iconfont"></i>提示文字</span>
							</div>
							<div class="form-group">
								<label for="input6" class=" control-label col-sm-1 ">
								<span class="select_l"><i>*</i>借款周期：</span></label>
								<div class="col-sm-6 select-inline">
									<label class="radio-inline">
										<input type="radio" name="term" id="term1" value="7">7天
									</label>
									<label class="radio-inline">
										<input type="radio" name="term" id="term2" value="15">15天
									</label>
									<label class="radio-inline">
										<input type="radio" name="term" id="term3" value="0" checked="">&nbsp;
									</label>
									<select name="termmonth" class="form-control" id="termMonth">
										<option value="30">1个月</option>
										<option value="60">2个月</option>
										<option value="90">3个月</option>
										<option value="120">4个月</option>
										<option value="150">5个月</option>
										<option value="180">6个月</option>
										<option value="210">7个月</option>
										<option value="240">8个月</option>
										<option value="270">9个月</option>
										<option value="300">10个月</option>
										<option value="330">11个月</option>
										<option value="360">12个月</option>
									</select>
								</div>
								<span class="form-control-tips "><i class="iconfont"></i>提示文字</span>
							</div>
							<div class="form-group">
								<label for="Rate" class=" control-label col-sm-1"><i>*</i>年利率：</label>
								<div class="col-sm-2">
									<input class="form-control Decimal" id="Rate" name="rate" type="number" step="any" value="">
									<span id="autoRate" title="autoRate" class="iconfont"></span>
								</div>
								<p class="form-control-static">%    年利息不能超多25%</p>
								<span class="form-control-tips"><i class="iconfont"></i><span class="error-text"></span></span>
							</div>
							<div class="form-group">
								<label for="input6" class=" control-label col-sm-1 "><i>*</i>还款方式：</label>
								<div class="col-sm-5 select-inline">
									<label class="radio-inline">
										<input type="radio" name="inlineOptions" checked="" id="inlineRadio2" value="1">
										每月还息
									</label>
								</div>
								<span class="form-control-tips " style="display: none"><i class="iconfont"></i>提示文字</span>
							</div>
							<div class="form-group">
								<label for="ExpiredAt" class=" control-label col-sm-1"><i>*</i>截止日期：</label>
								<div class="col-sm-2">
									<select class="form-control" name="overtimestr">
										<option value='3'>-3天-</option>
										<option value='3'>-5天-</option>
										<option value='3'>-7天-</option>
										<option value='3'>-15天-</option>
									</select>
								</div>
								<p class="form-control-static">如果超过截止日期仍未完成100%投标，则自动取消该笔借款</p>
								<span class="form-control-tips" style="display: none"><i class="iconfont"></i>提示文字</span>
							</div>
						<div class="pad">
							<div class="form-group">
								<label for="Description" class=" control-label col-sm-1">借款描述：</label>
								<div class="col-sm-9">
							<textarea class="form-control" cols="20" id="Description" name="descrp" rows="6"></textarea>
								</div>
								<p class="form-control-static" style='margin-left:90px;'>请保持最多200个汉字</p>
							</div>
							<div class="btn_area">
							<if condition="$count eq 0">
							<else/>
								<input type="button" action="confirm_borring" id="LoanApply"
								 class="btn btn-warning btn-xs-block" value="申请贷款">
							</if>
							</div>
						</div>
						</div>
					</div>
				</section>

			</div>
		</div>
		</form>
		       
</div>
    
    
    <div class="clr"></div>
        </div>
        <div class="clr"></div>
    </div>
 <div popup="confirm" class="reveal-modal medium" topmeasure="50" topoffset="256" locked="false" animation="none" 
    animationspeed="500" closeonbackgroundclick="true" dismissmodalclass="close-reveal-modal" 
dismissjqobject="[action=&quot;cancel&quot;]" z-index="1001" switch="open" style="z-index: 1002; display: none; top: 650px;">
    <a class="close-reveal-modal" action="closeModal">×</a>
    <div class="confirm-inner">
            <img src="{$app_path}{$static_path}/img/icon_orange_question.png">
            <span action="msg"></span>
    </div>

    <div class="split-dot mb20 text-center"></div>
    <div class="form-row">
        <a action="confirm" class=" button button-orange w40 fl">确定</a>
        <a action="cancel" class=" button button-gray w40 fr">取消</a>
        <div class="clr"></div>
    </div>
</div><div class="reveal-modal-bg" style="display: none;"></div>
<include file="./Public/public/footer.html" />
<script type="text/javascript">
$("#sall").click(function(){
	if($(this).is(':checked')){
		$("input[name='domainidstr']").prop("checked", true);
	}else {
		$("input[name='domainidstr']").prop("checked", false);
	}
});


$('[action=confirm_borring]').click(function () {
	var ids='';
	$('input[name="domainidstr"]:checked').each(function(){ 
		ids=$(this).val()+','+ids;
	});
	$("#domainid").val(ids);
    showConfirm({
        msg:"您确定发布此域名抵押借款需求?",
        confirmed:function(){
            isCancelling = false;
            $.ajax({
        		type: "POST", 
        		url:$("#BorrowForm").attr("action"), 
        		data:$('#BorrowForm').serialize(),// 你的formid 
        		async: false, 
        		error: function(request) { showModal("system error");}, 
        		success: function(data){
        			if(data.code!='success'){
        				showModal(data.info);
        			}else{
        				showModal(data.info);
        				setTimeout(function() { 
        					location.href='{:U('Mycredit/myloaderinfo')}';
        					},3000);
        			}
        		}
        	}).fail(function(){
                isCancelling = false;
            });
        }
    });
});
$("#categorid").change(function(){
	var cateid = $(this).val();
	if(cateid.length>0){
		$.ajax({
    		type: "POST", 
    		url:"{:U('Mycredit/userdomaincredit')}", 
    		data:{'cateid':cateid},// 你的formid 
    		async: false, 
    		error: function(request) { showModal("system error");}, 
    		success: function(data){
    			$("#diyacount").text(data.count);
    			var htmldomain="";
    			$.each(data.info, function(n,value){
    				htmldomain+="<li><label><input type='checkbox' value="+value.id+" data-amount="+value.id+
    				" name='domainidstr'>"+value.domain+"</label></li>";
    			});
    			$("#domainlistid").html(htmldomain);
    		}
    	})	
	}
});
 
</script>
</body></html>